home *** CD-ROM | disk | FTP | other *** search
/ United Public Domain Gold 2 / United Public Domain Gold 2.iso / music_utilities / pt012.dms / pt012.adf / NoDelete / NoDelete.doc < prev    next >
Text File  |  1992-05-14  |  18KB  |  364 lines

  1.  *************************************************************************
  2.  *              NoDelete V2.01  (C) HooverSoft  Feb 1992                 *
  3.  *************************************************************************
  4.  
  5.                                   PREFACE
  6. Well,  I'm  back.   I  have  been  quite busy during 1991 which left me with
  7. little time to work on this program (things like becoming a father of a baby
  8. boy,  getting  on  with  my  studies  and moving places twice).  Some people
  9. suggested  that  NoDelete  still needed lots of work before it would be what
  10. I'd  call  a  really nice little hack, and so Version 2.01 (the current one)
  11. includes  several new features.  The biggest changes were done in the string
  12. handling routines.  Patterns can now be any length up to 255 characters, but
  13. I  hope no ones uses file name monsters like these, and up to fifty patterns
  14. can  be  selected.  Furthermore it is now possible to interactively edit (or
  15. wipe  out)  patterns in a string gadget while NoDelete is running which will
  16. be  made  the active patterns once RETURN is pressed.  For more information,
  17. please see below.
  18.  
  19.                            WHY USE NODELETE?
  20. NoDelete  can  literally  save  you hours of work.  Days of work!  Months of
  21. work!   I'm  not exaggerating.  :-) If NoDelete is installed on your system,
  22. you  will be asked to confirm *any* attempt to delete a file on any AmigaDOS
  23. disk device, and this means not just deletions that you choose to make while
  24. working with the Shell, but also for any other program running in background
  25. or  trying  to do other nasty things.  Say you've been working for months on
  26. the  file  'WormSpace.tex',  a  paper describing just how time travel can be
  27. made  possible.  You finish your work on Friday 13th of Jan, 2001 and before
  28. you  go  to  sleep  through  what's left of the night you decide to wipe all
  29. these  ugly  .log  and  .aux files that TeX leaves lying around.  Being half
  30. blinded by fatigue, you type 'delete *.*' and unsuspectingly press <RETURN>.
  31. Now,  this  might  be the right time to shoot yourself if it hadn't been for
  32. NoDelete  which will ask you if you *really* *really* really* want to delete
  33. those  precious  TeX  sources.   Should the above (fictuous) sitution become
  34. true,  please  send  me  1% of your Nobel prize :-) or at least a nice 68040
  35. board.  :-)
  36.  
  37. You  will  also  benefit from NoDelete if you're not in for the Nobel prize.
  38. If  you're  willing  to  be called 'traitor' by honest nethack players, then
  39. read  on:  You can keep NetHack from constantly deleting those precious save
  40. files.
  41.                               WHAT IT DOES
  42. NoDelete  enables  you  erraneous  humans  to  once  again  reflect  on the
  43. righteousness  of  your  decisions  concerning  the  deleting  of  files on
  44. AmigaDos devices.  If you try to delete a file or a program tries to remove
  45. it,  this  is  mostly  done  via  DeleteFile()  of  the  dos.library.  When
  46. executed,  NoDelete  bends  this  vector to its own routine which brings up
  47. this  cute  little requester on the active window.  This requester contains
  48. the  name  of  the file that the system is trying to delete.  If you really
  49. want  to  delete  this  file,  click to the "Yes, Delete!" gadget.  If not,
  50. click  to the "Oops, no way!"-Gadget of the requester.  NoDelete works just
  51. fine   with   aliases,   wildcards   etc.   For  problems  see  the  "known
  52. bugs"-section of this text.
  53.  
  54.                                  PATTERNS
  55. Lots  of programs, programmers and normal people use patterns in their file
  56. system  to  be  able  to  immediately make out the contents of a file.  For
  57. example,  ".c"  specifies  the file to be a C source code and ".bas" should
  58. contain  a  basic  program's  source.   There  are  tons of frequently used
  59. extensions,  from  ".asm"  up to ".cfg".  If you use NoDelete and you don't
  60. want  the  system to get on your nerves by confirming EVERY rm command, you
  61. should  use a certain extension on NoDelete's command line to tell NoDelete
  62. that  it  should  only  ask  confirmation for those precious ".c" or ".iff"
  63. files and let all others alone.
  64.  
  65. The  new  version  of  NoDelete also supports complete filenames as pattern
  66. matching is done via PatternMatch() of ARP.  The command line
  67.  
  68.       1> run nodelete *.c
  69.  
  70. would  tell NoDelete to only intercept the removing of files ending in ".c"
  71. and not to worry about any other files that are being deleted on the device.
  72.  
  73. You  can  specifiy  up  to fifty  patterns of abitrary length when
  74. running NoDelete.  The command
  75.  
  76.       1> run NoDelete *.c *.iff *.tex *.asm *.sav
  77.  
  78. will  make  NoDelete complain about any file being deleted which ends in one
  79. of the specified patterns and leave all others alone.  If you have forgotten
  80. which  patterns  you specified at startup, just activate NoDelete's titlebar
  81. and  press  <SPACE>.   NoDelete  will  then  give  a list of patterns in the
  82. titlebar until another key is pressed.
  83.  
  84. Another one:
  85.  
  86.       1> run NoDelete Peter Pecker picked a pepper
  87.  
  88. would  intercept  any  attempt to remove the files peter, pecker, picked, a,
  89. and  pepper.  If the extensions get too long to fit into the titlebar, press
  90. 'e'  for edit instead of <SPACE>.  This will bring up a little window with a
  91. string gadget in it so you can scroll through the patterns selected.  If you
  92. don't  want  to  edit  any  of  these, use the close gadget of the window to
  93. remove  it, and no changes will be made to the active patterns.  Only if you
  94. press  <RETURN>  with  the  string  gadget active the string entered will be
  95. parsed  and  the  new patterns be set.  To make things totally clear, let me
  96. cite the ARP programmer's manual:
  97.  
  98. CITE
  99. arp.doc/PatternMatch (V31)
  100.  
  101.    NAME
  102.       PatternMatch - perform a wildcard match on a string
  103.  
  104.    SYNOPSIS
  105.       result = PatternMatch(pat,str)
  106.         D0                 A0   A1
  107.  
  108.    FUNCTION
  109.       This function compares a string to the given pattern and determines
  110.            if it is a valid match.  If so it returns a true result.
  111.            The pattern must be constructed with special preparsed tokens and
  112.            supports the following patterns:
  113.             (p1|p2|p3)  One of the patterns p1, p2 or p3
  114.             ?           Any single character
  115.             #<pat>      Pattern repeated 0 or more times
  116.             [class]     Character class
  117.             [^class]    Negated character class
  118.             {pat}       Structure tag for replacement
  119.             *           0 or more occurances of any character
  120.  
  121.    INPUTS
  122.      char *pat     The pattern string to match against
  123.           char *str     The string to be matched
  124.  
  125.    RESULT
  126.      result - a boolean value indicating success/failure.  The condition
  127.          codes are guarenteed to reflect the status of the result
  128.  
  129.    BUGS
  130.      None known.
  131.  
  132.    SEE ALSO
  133.  
  134.    Author:  JAT
  135. END CITE
  136.  
  137. Right?  So far for all the wildcards you can use with ARP.  IMPORTANT NOTE:
  138. if  you  work  with  Csh  or  WB  1.3  shell,  you  will have to escape the
  139. characters special to these shells, respectively.  To protect all C sources
  140. while in Csh, you would use the syntax
  141.  
  142.       $ run nodelete \*.c
  143.  
  144. to have the special shell wildcard "*" survive on its way to NoDelete.
  145.  
  146.                        PROTECTING ENTIRE DIRECTORIES
  147. If  you  want  NoDelete  to  protect  entire  directories  on your disk, use
  148. something like
  149.  
  150.       1> run NoDelete s:* dh0:s/*
  151.  
  152. to  prevent any program deleting files residing in the S:  directory.  NOTE:
  153. this  will  not  work  if the current directory of the process attempting to
  154. delete a file happens to be S:.  This is due to the fact that a program that
  155. has  its  current  directory  set to s:  usually only passes the filename to
  156. DeleteFile() and not the complete pathname.
  157.  
  158.                            COMMAND LINE OPTIONS
  159.  
  160. The folowing is a list of command line options that can be used when
  161. invoking NoDelete from the CLI:
  162.  
  163. -p number   where number is an integer between -20 and 9. If given on
  164.             the command line, NoDelete will set its priority to this
  165.             value.  If you type rubbish or use values not allowed, the
  166.             default priority of -5 is set.
  167.  
  168. -y ypos     where ypos is an integer ranging from zero to 245 (sorry,
  169.             all you NTSC users...).  This number will determine the ver-
  170.             tical position of NoDelete's titlebar.  if you try to fool
  171.             NoDelete or do not give this option, the default value zero
  172.             (top of screen) is used.
  173.  
  174. -O          Override file protection bit. If this option is given,
  175.             NoDelete will NOT care about the file's protection status.
  176.             This option is sort of dangerous, but I think if you are
  177.             explicitly asked wether you want to delete a file this
  178.             should be presto! wiped off the disk without return or
  179.             any other chance of survival..., Anyway, the default now
  180.             is to consider and respect the file protection.
  181.  
  182. -S          if given, this option tells NoDelete to shut up. No screams,
  183.             no comments!
  184.  
  185.                   KEY COMMANDS WITH NODELETE WINDOW ACTIVE
  186. There  are  a  couple of commands that NoDelete understands if its window is
  187. active.   Just  press  the  key displayed in the left column to activate the
  188. command.  The following is a list of currently implemented keys:
  189.  
  190. <SPACE>     GIVE A LIST OF CURRENTLY ACTIVE PATTERNS. If the list of
  191.             patterns is longer than the window title, only the first few
  192.             patterns fitting into the bar will be displayed.
  193.  
  194. c           CLEAR CURRENTLY ACTIVE PATTERNS. This means that from now on
  195.             all attempts to delete files will be moaned about and not
  196.             just those that matched the previously active patterns.
  197.             You can see by NoDelete's Titlebar displaying 'NO PAT' at the
  198.             end that every DeleteFile() call will be intercepted.
  199.  
  200. e           EDIT PATTERNS. This function lets you edit the active patterns
  201.             it brings up a litte window with a string gadget displaying the
  202.             patterns that are active.  If none were active before, an empty
  203.             string will be displayed.  Enter and edit new patterns or delete
  204.             old ones to your heart's content and then press <ENTER> to
  205.             activate the newly edited ones.  If you decide that you'd rather
  206.             keep the old ones, use the CLOSE gadget of the window to get
  207.             them back.
  208.  
  209. q           QUIT. This is just a shorthand for closing down NoDelete. It
  210.             has the same effect as clicking on the Close gadget of the
  211.             window.
  212.  
  213.  
  214.                     RUNNING NODELETE FROM THE WORKBENCH
  215. An  icon  is  supplied in this archive to enable you to launch NoDelete from
  216. the  Workbench.   When  you do so, all settings like the vertical positon of
  217. the window and the priority will be set to their default values and NoDelete
  218. will  come  up  with no patterns set.  Should you want to use patterns, edit
  219. them interactively as described above.
  220.  
  221.                                KNOWN BUGS
  222. The  Shell  won't complain if you try to delete any non-existent file while
  223. NoDelete  has  its  grip  on  the system.  This is not really a bug because
  224. NoDelete  works  on  this  basis  of  cheating  the  calling  function  and
  225. pretending  that  everything  is  just  fine and deleted.  This also is the
  226. cause that the calling program will not be informed if the file in question
  227. is delete protected.
  228.  
  229.                             THE LEGAL STUFF
  230. NoDelete  is  FreeWare  and  may  be  copied  freely  by everyone except for
  231. purposes  listed  below as long as this notice is left intact.  This program
  232. is copyright (C) by HooverSoft.  It may NOT be copied or sold for commercial
  233. purposes without written permssion by the author (Get lost, Carsten Wolf and
  234. all  you  other  sharks!).   It  may  be  distributed  and copied freely for
  235. non-commercial  purposes  only.   Express  permission to distribute NoDelete
  236. with the AmigaLibDisks is given to Fred Fish (cheers, mate!  :-).
  237.  
  238. When  distributed,  this  program should always be accompanied by this file,
  239. the  documentation.   The  price  of the distribution disk may not surpass 5
  240. German Marks or the equivalent in any foreign currency.
  241.  
  242. Should  you  feel  the  urgent  need  to reward the efforts of the author in
  243. writing  this  thing, feel free to make a donation to your favourite charity
  244. like  Greenpeace  or  some  similar  organization attempting to do something
  245. about  the  destruction of this planet.  Please don't forget that the worlds
  246. this  fantastic  computer creates aren't real...please drop me a line if you
  247. have  made  a  donation.  This will make programming even more rewarding for
  248. me.
  249.  
  250.  
  251.                     FURTHER PLANS & HOPELESS DREAMS
  252. I  would  like  to use CreateTask() to launch a separate Task for Nodelete.
  253. This would unlink NoDelete's memory requirements from the current stacksize
  254. of  the system.  Someone willing to tell us how to answer AutoRequest()s by
  255. keystrokes?  I'm listening!
  256.  
  257.                                   CREDITS
  258. I'm  very  thankful  to  all  those  people who have continued to make their
  259. sources  available  through FreeWare, especially Fred Fish, Udo K Schuermann
  260. (The  walrus  and  maintainer  of Akvarium Data Files) and Matt Dillon.  See
  261. this  project  as an attempt to pay the debt that I owe to you.  Many "thank
  262. you"'s go to Bernd Heide for drawing the NoDelete icon.
  263.  
  264.                             PUBLIC FEEDBACK
  265. Bug reports (cheers, Jensi & John & David & Holger & & &...+ all the others
  266. too  numerous  to  mention), criticism, comments and approvements should be
  267. sent to
  268.  
  269.                                    SNAIL:
  270.                               HooverSoft Inc.
  271.                             Joellenbecker Weg 4
  272.                               D-4900 Herford
  273.                                   Germany
  274.  
  275.                                  INTERNET:
  276.                  hoover@math20.mathematik.uni-bielefeld.de
  277.  
  278. Actually, you can reach me on any host from math[1-22] of the above address,
  279. just select the one that's not currently out of action. ;-)
  280.  
  281.                                 DISCLAIMER
  282. Do  whatever you like with this program, but listen:  you can't blaim it on
  283. me if anything goes down the drain!
  284.  
  285.  
  286.                                   HISTORY
  287.  
  288.                      CHANGES TO VERSION 1.51: FEB 1992
  289. The  jump  in  the  version  number might seem a bit too high, but V1.51 was
  290. posted  to comp.sources.amiga but somehow never got through.  There's been a
  291. lot  of  work  done  on this program, so I had to push up the Release number
  292. like  that.   Changes  include interactive pattern editing, dynamical memory
  293. allocation  for  patterns,  a bug fix with the SetTaskPri() call and lots of
  294. other  things.   Another  bug  in previous versions would allow you to close
  295. down  NoDelete even if a requester was active.  Result:  -> Crash.  This has
  296. also been fixed.
  297.  
  298.                      CHANGES TO VERSION 1.5: MAY 1991
  299. Due  to  public  request  I've  tried  to make NoDelete Kick2.0-compatible.
  300. NoDelete  will  now check for a version number of dos.library >=36 and then
  301. make the appropriate changes in the jump table.
  302.  
  303. The  check  to  see  if  NoDelete  is  already  installed is now made via a
  304. FindPort().   If  NoDelete  is  installed,  a  port named 'nd_port' will be
  305. hanging around in your system.  Just don't worry, this is not a new virus.
  306.  
  307.   Furthermore  a  bug was killed in the command line parse & the source was
  308. freed of some nasty words some people might have found offensive...:-)
  309.  
  310.                      CHANGES TO VERSION 1.4: MAR 1991
  311. Switched  to  ARP  (finally).   This  great  bunch  of routines should have
  312. experienced  a  wide  enough  distribution  by now to make this acceptable.
  313. Cheers to everyone involved in this project!  ARP is used to do the pattern
  314. matching  on filenames.  No more restriction is made on the patterns.  They
  315. can  be  complete  filenames  or  just  patterns,  with  every ARP wildcard
  316. allowed.   I forgot the name of the guy who suggested this one, and answers
  317. by  UUCP  is not a favourite of math4.unibi.de.  Anyway, as soon as this is
  318. implemented, you'll get a "thank you", mate!
  319.  
  320.                      CHANGES TO VERSION 1.35: OCT 1990
  321. Programmed  two  new options -O and -S (Cheers, John!).  These options sort
  322. of  "fix"  a  bug  with NoDelete which used to override the file protection
  323. bit.
  324.  
  325.                      CHANGES TO VERSION 1.3: SEP 1990
  326. Lots  of  changes.   Thinking  of  writing  a  new  documentation.  Anyway,
  327. introduced  command line options -p and -y for run-time setting of priority
  328. of NoDelete and of vertical position of titlebar.
  329.  
  330.                      CHANGES TO VERSION 1.2: AUG 1990
  331. Introduced  the  possibilty  to  give  multiple patterns on startup.  Lists
  332. patterns when pressing a key while Nodelete's titlebar is active.
  333.  
  334.                      CHANGES TO VERSION 1.1: AUG 1990
  335. NoDelete now automatically centers the Dragbar on Screen and calculates the
  336. correct width for the window if a pattern is specified.
  337.  
  338. Now  works  fine  with  AmiOmega.   System won't crash if "Yes, Delete!" is
  339. selected.
  340.  
  341. Now  supports  the  use  of  patterns to ask confirmations only for special
  342. files  ending  in  defined  pattern.   Will  show  the  selected pattern in
  343. window's titlebar.
  344.  
  345. NoDelete  now  checks  if  another  NoDelete is already active and exits if
  346. true.
  347.  
  348.                      CHANGES TO VERSION 1.01: JUL 1990
  349. Now handles protected Files correctly.  Previous version didn't complain if
  350. file was delete protected.
  351.  
  352. NoDelete sets its priority to a value of -5 directly after startup.
  353.  
  354.                      CHANGES TO VERSION 1.00: JUN 1990
  355. Version  1.01  now  restores  the  Dos Vector relative to _DosBase, so this
  356. program  should  work under Kickstart 1.3 as well.  If someone already uses
  357. Kick 2.0, he or she should let me know if NoDelete works with that.  I have
  358. heard  that  the  funny  instructions  in DosBase have been replaced with a
  359. regular jump table.
  360.  
  361. Have fun,
  362. Hoover
  363.  
  364.